<script setup lang="ts">
import { LoginIn } from '$/client'
import type { CommonFormProps } from '@/types'
import { At as IAt, User as IUser } from '@vexip-ui/icons'
import { Form, FormItem, FormSubmit, Input } from 'vexip-ui'

defineProps<CommonFormProps>()

const model = defineModel<LoginIn>({ required: true })
</script>

<template>
  <Form :model="model" :loading="loading">
    <FormItem label="用户名" prop="username" required>
      <Input :prefix="IUser" />
    </FormItem>
    <FormItem label="密码" prop="password" required>
      <Input :prefix="IAt" />
    </FormItem>
    <FormItem action>
      <FormSubmit label="登录" @submit="submit" block />
    </FormItem>
  </Form>
</template>
